package lesson.Client;

import java.io.IOException;
import java.net.*;

public class ClientDemo1 {
    public static void main(String[] args) throws IOException {
        //快递点
        DatagramSocket datagramSocket = new DatagramSocket();

        //打包礼物
        String s = "只因出只因";
        byte[] b = s.getBytes();
        //发给谁
        InetAddress address = InetAddress.getByName("127.0.0.1");
        //给哪个程序发
        //包装东西
        DatagramPacket dp = new DatagramPacket(b,b.length,address,10000);

        //由快递点发送包裹
        datagramSocket.send(dp);
        //付钱走人
        datagramSocket.close();

    }
}
